<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddRefundColumnsToBizPayRecordMigration extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $this->table('biz_pay_record')
            ->addColumn('refund_status', 'integer', ['default' => 0,'comment'=>'退款状态 0:未退款 1:退款中 2:已退款'])
            ->addColumn('refund_record_id', 'integer', ['default' => 0,'comment'=>'退款记录ID'])
            ->addColumn('refund_at', 'integer', ['default' => 0,'limit' => 11,'comment'=>'退款时间'])
            ->update();
    }
}
